// 对象类型的简单回顾
type personType = {
    name: string,
    age: number,
    sex?: boolean,// 该属性是可选的
}


const person: personType = {
    name: "陶品奇",
    age: 22,
    sex: true,
}

// 对象类型和函数类型结合使用
function printCoordinate(point: { x: number, y: number }): string {
    return `x值${point.x}y值是${point.x}`
}

const p: string = printCoordinate({x: 200, y: 300})
console.log(p)

function getPersonInfo(person: personType): personType {
    return person
}

const r = getPersonInfo({
    name: "陶品奇",
    age: 22,
    sex: true,
})
console.log(r)



